package com.example.mapper;

import com.example.pojo.CarPageQueryDTO;
import com.example.pojo.CarVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.*;
import com.example.pojo.Car;

import java.util.List;

@Mapper
public interface CarMapper {

    @Insert("insert into car( name, type, number, status) values (#{name},#{type},#{number},#{status})")
    void insert(Car car);
@Select("select * from car ")
Page<Car> pageQuery(CarPageQueryDTO carPageQueryDTO);
@Delete("delete from car where id = #{id}")
    void delete(Integer id);
@Update("update car set status=0 where id = #{id}")
    void lendCar(Integer id);
    @Select("select count(id) from car where id = #{id}")
    Integer updateStatus(Integer id);
@Select("select  status from car where id = #{id}")
    Car findStatus(Integer id);
@Update("update car set status=1 where id = #{id}")
    void revert(Integer id);

//    @Select("select * from car ")
//    Page<Car> pageQuery(int page, int size, String name);

}
